package com.ls.controller.booth;

import com.ls.controller.booth.model.AddBoothModel;
import com.ls.controller.booth.model.EditBoothModel;
import com.ls.controller.booth.model.EditIndexModel;
import com.ls.service.IBoothService;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @ClassName BoothAppController
 * @Description app卡座控制器
 * <p>
 * 卡座
 * APP专用接口
 * </p>
 *
 * @author pengyu
 * @since 2024-06-28
 */
@Api(value = "app卡座相关接口", tags = "app卡座相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/boothApp")
public class BoothAppController {
    private final IBoothService service;
    /**
     * 新增卡座
     */
    @PostMapping(value = "add")
    public ResultData add(@Valid @RequestBody AddBoothModel model) {
        return service.add(model);
    }

    /**
     * 编辑卡座
     */
    @PostMapping(value = "edit")
    public ResultData edit(@Valid @RequestBody EditBoothModel model) {
        return service.edit(model);
    }

    /**
     * 删除卡座
     */
    @PostMapping(value = "del")
    public ResultData del(@RequestParam Long boothId) {
        return service.del(boothId);
    }
    /**通过id查询*/
    @GetMapping(value = "getById")
    public ResultData getById(@RequestParam Long boothId) {
        return service.getBoothById(boothId);
    }
    /**编辑卡座排序*/
    @PostMapping(value = "editIndex")
    public ResultData editIndex(@Valid @RequestBody EditIndexModel model) {
        return service.editIndex(model);
    }
}
